package com.liveinstars.account.business.domain.bo;

public enum AccountEnum {
	MOBILE(1,"mobile"),
	EMAIL(2,"email"),
	USERNAME(3,"username"),
	QQ(4,"qq"),
	WEIXIN(5,"weixin"),
	WEIBO(6,"weibo");
	
	private Integer accountType;
	private String accountMsg;
	private AccountEnum(Integer accountType, String accountMsg) {
		this.accountType = accountType;
		this.accountMsg = accountMsg;
	}
	
	public Integer getAccountType() {
		return accountType;
	}
	public void setAccountType(Integer accountType) {
		this.accountType = accountType;
	}
	public String getAccountMsg() {
		return accountMsg;
	}
	public void setAccountMsg(String accountMsg) {
		this.accountMsg = accountMsg;
	}
	
	public static String getAccountMsg(Integer accountType){
        for (AccountEnum e : values()) {
            if (e.getAccountType().equals(accountType)) {
                return e.getAccountMsg();
            }
        }
        return "";
    }
	
	public static Integer getAccountType(String accountMsg) {
		for (AccountEnum e : values()) {
            if (e.getAccountMsg().equals(accountMsg)) {
                return e.getAccountType();
            }
        }
        return null;
	}
}
